<template>
  <el-container class="home-safe" v-loading="loading">
    <el-header class="header" style="margin-bottom: 0">
      <el-form ref="ruleFormRef" class="between-form" :inline="true">
        <div>
          <div class="tab-select border">
            <span
              v-for="(item, index) in [
                {
                  objectId: '1',
                  tableNameChn: '企业',
                },
                {
                  objectId: '2',
                  tableNameChn: '商户',
                },
              ]"
              class="btn nobg"
              :class="{
                active: currentTab == item.objectId,
                noright: index == tabList.length - 1,
              }"
              @click="selectTab(item.objectId)"
              :key="index"
              >{{ item.tableNameChn }}</span
            >
          </div>
        </div>
      </el-form>
    </el-header>
    <enterprise v-if="currentTab == 1"></enterprise>
    <merchant v-if="currentTab == 2"></merchant>
  </el-container>
</template>

<script setup>
import { onMounted, ref, reactive } from "vue";
import enterprise from "./enterprise.vue";
import merchant from "./merchant.vue";
// 获取顶层tab
let currentTab = ref("1");
let tabList = ref([]);
const selectTab = (index) => {
  currentTab.value = index;
};
</script>

<style lang="scss" scoped>
.home-safe {
  width: 100%;
  height: 100%;
  position: relative;

  .header {
    min-height: 36px;
    line-height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
    margin-bottom: 18px;
    .header-l {
      display: flex;
      align-items: center;
      .text {
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 14px;
        color: #666666;
        line-height: 22px;
        letter-spacing: 1px;
        text-align: left;
        padding-left: 14px;
      }
    }
  }

  .more-header {
    padding: 0 !important;
    border-radius: 6px;
    .search-down {
      width: 100%;
      text-align: center;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 14px;
      color: #666666;
      line-height: 20px;
      cursor: pointer;
      .icon-down {
        display: inline-block;
        transform: rotate(-90deg);
        margin-right: 8px;
      }
    }
  }
}
.el-container {
  height: 100% !important;
  padding: 0 !important;
}
.el-header {
  height: auto !important;
  min-height: 36px !important;
}
.el-main {
  padding: 0 !important;
}
.search {
  margin: 0 50px;
}
</style>
